Chore: Clean up extend impls for BufferMut#5055
Merged
Merged
Conversation
052df43 to
49a7552
Compare
CodSpeed Performance ReportMerging #5055 will degrade performances by 20.37%Comparing Summary
Benchmarks breakdown
|
Codecov Report❌ Patch coverage is
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
gatesn
reviewed
Oct 23, 2025
Closed
49a7552 to
154a5ed
Compare
Closed
gatesn
reviewed
Oct 23, 2025
| I: TrustedLen<Item = T>, | ||
| { | ||
| // We allow the `extend_trusted` method to correctly allocate the required memory. | ||
| let mut buffer = Self::with_capacity(0); |
Contributor
There was a problem hiding this comment.
It's actually more efficient to pass the correct capacity here from the trusted iter, otherwise we do two allocations instead of one.
Member
Author
There was a problem hiding this comment.
I think this is related: #5044, putting this here for the link
gatesn
approved these changes
Oct 23, 2025
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
154a5ed to
8e8fa8b
Compare
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
robert3005
approved these changes
Oct 24, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I'm moving this from #5049 since things are becoming more complicated.
The only logical change here is at the top of
extend_iter:And the other is now using
offset_from_unsigned(used to be calledptr_subon nightly)